home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_asm
/
zendisk1
/
lst10-14.asm
< prev
next >
Wrap
Assembly Source File
|
1990-02-15
|
636b
|
28 lines
;
; *** Listing 10-14 ***
;
; Generates the 8-bit checksum of a 1000-byte array
; using LODS with an ES: override.
;
jmp Skip
;
FarSeg segment para
ARRAY_LENGTH equ 1000
ByteArray db ARRAY_LENGTH dup (0)
FarSeg ends
Skip:
call ZTimerOn
mov si,seg ByteArray
mov es,si ;point ES:SI to the array to
; checksum
mov si,offset ByteArray
mov cx,ARRAY_LENGTH ;# of bytes to checksum
sub ah,ah ;zero the checksum counter
cld ;make LODS move the pointer up
ChecksumLoop:
lods byte ptr es:[si]
;get the next byte to checksum
add ah,al ;add the byte into the checksum
loop ChecksumLoop
call ZTimerOff